FROM nvidia/cuda:12.8.0-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates curl wget git vim \
    build-essential cmake \
    python3.11 python3.11-dev python3.11-venv python3-pip \
    libnuma-dev && rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
 && python3 -m pip install --upgrade pip setuptools wheel
WORKDIR /workspace
RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu128 torch torchvision
RUN python3 -m pip install --no-cache-dir triton
RUN python3 -m pip install --no-cache-dir jupyterlab notebook numpy scipy matplotlib pandas tqdm ipywidgets tensorboard
#RUN mkdir -p /root/.jupyter \
# && echo "c.NotebookApp.ip = '0.0.0.0'\nc.NotebookApp.port = 8888\nc.NotebookApp.open_browser = False\nc.NotebookApp.allow_root = True\nc.NotebookApp.token = ''" > /root/.jupyter/jupyter_notebook_config.py
RUN mkdir -p /root/.jupyter \
    && echo "c.ServerApp.ip = '0.0.0.0'\n\
c.ServerApp.port = 8888\n\
c.ServerApp.open_browser = False\n\
c.ServerApp.allow_root = True\n\
c.IdentityProvider.token = ''\n\
c.ServerApp.disable_check_xsrf = True\n\
c.ServerApp.allow_origin = '*'" \
> /root/.jupyter/jupyter_server_config.py
RUN mkdir -p /workspace/triton-tutorial
COPY examples/ /workspace/triton-tutorial/
CMD ["jupyter", "lab", "--allow-root"]
